<?php
//列出目录,方便查找的小程序
#BY 边缘狂人
#2013年9月4日
date_default_timezone_set('PRC');
header('content-type:text/html;charset=utf-8');

$base_dir = "./";
$TIME = time();



$dirs = array(
'',
//'/data/ipdata',

//'/require',
);
$files = array();

#打开目录22
$dp = opendir($base_dir . $v);
$i = 0;
$d_p = str_replace('\\','/',dirname(__FILE__));

while($file = readdir($dp))
{
	if('.php' != substr($file, -4, 4) || $file{0} == '_')
	{
		//continue;
	}
	if($file{0} == '.')
	{
		continue;
	}

	$files[] = $v . '/' . $file;
	if(!is_dir($file))
	{
		continue;
	}
// &nbsp;<a href='file:///{$d_p}/{$file}'>打开目录</a>
	echo "{$i} <a href='{$file}' target='_blank'>{$file}</a> <input type='text' value='{$d_p}/{$file}' style='width:30px;'> <br>";
	$i++;
}
closedir($dp);



exit;

//对数组值的长度排序
function mysort($arr)
{
	$newarr = array();
	$tmp = array();
	global $EXP;
	
	foreach($arr as $k => $v)
	{
		if(is_numeric($v))
		{
			continue;
		}
		if(in_array($v,$EXP))
		{
			continue;
		}
		$tmp[$k] = strlen($v);
	}
	arsort($tmp);
	foreach($tmp as $k => $v)
	{
		$newarr[] = $arr[$k];
	}
	return $newarr;
}
function md55($v)
{
	global $TIME;
	return '$XxXx' . md5($TIME . $v);
}

#大大大大大磊
?>